
# test_str="11100011"
# print(test_str.split("1"))
# chewei=list(test_str)

s="".join(list(map(str,input().split(","))))
print(s)
def getResult():
    arr=s.split("1")
    maxLen=0
    for i in range(0,len(arr)):
        ele=arr[i]
        if i==0 or i==len(arr)-1:
            maxLen=max(len(ele),maxLen)
        else:
            if len(ele)==1:
                maxLen=max(maxLen,1)
            else:
                maxLen=max(maxLen,len(ele)//2)
    return maxLen
print(getResult())

